<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>

<style>

.one_box{
    width: 200px;
    height: 200px;
    border: 1px solid #000;
}

.one{
    margin: 20px;
    /* margin: 20px;   左右margin生效  */
    /* margin-bottom: 50px; 上下不生效 */
    background-color: red;
}
.cs_box{
    width: 50px;
    height: 50px;
    border: 1px solid #000;
}

.one_box2{
    width: 200px;
    height: 200px;
    border: 1px solid #000;
}

.two{
    padding: 20px;
    /* 左右会生效 上下盒子会变大 但是不会撑开其他元素 */
    background-color: red;
}
.cs_box2{
    width: 50px;
    height: 50px;
    border: 1px solid #000;
}
</style>
<body>
    <div class="one_box">
        <span class="one">我是第一个sapn</span>
        <span class="cs">测试的span</span>
        <div class="cs_box">测试的box</div>
    </div>

    <div class="one_box2">
        <span class="two">我是第一个sapn</span>
        <span class="cs2">测试的span</span>
        <div class="cs_box2">测试的box</div>
    </div>

</body>
</html>